package org.csmzxy.class233;

class EmergencyThread implements Runnable{
    @Override
    public void run(){
        for (int i = 1; i <4; i++){
            System.out.println(Thread.currentThread().getName() + "输出:" + i);
        }
    }
}
public class Example06 {
    public static void main(String[] args) throws  InterruptedException{
        //创建线程对象
        Thread thread1 =new Thread(new EmergencyThread(),"thread1");
        thread1.setPriority(1);
        thread1.start();
        for (int i = 1; i < 4; i++){
            System.out.println(Thread.currentThread().getName()+"输出:" + i);
            if (i == 2){
                thread1.join();
            }
        }
    }
}
